package com.cotte.flow.controller;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/linux")
public class testController {

	@GetMapping("get")
	public void getFile() throws Exception {
		String path = "/file/F001_XF_RELATIONS.txt";
		//String path = File.separator+"file"+File.separator+"F001_XF_RELATIONS"+".txt";
		InputStream is = this.getClass().getResourceAsStream(path);
		//InputStream is = new FileInputStream(path);
		String line = null;
		BufferedReader reader = new BufferedReader(new InputStreamReader(is));
		line = reader.readLine();
		while (line != null) {
			String[] arr = line.split("\t"); 
			System.out.println("arr[0]"+arr[0]);
			line = reader.readLine();
		}
	}
}
